ABS

Syntax: ABS (number)
    or  ABS { number }   (Minerva only)
Location: QL ROM

This function returns the absolute value of a number - ie. the positive difference (or distance) between zero and the number.

The absolute value of a positive number (including zero) therefore, is the number itself - negative numbers are converted to positive.  This function will happily handle 32-bit integer numbers (-INTMAX..INTMAX, roughly -1E9..1E9).

MINERVA NOTE:
ABS can accept more than one parameter.

This version of ABS will square each parameter, and return the square root of the total of those squares, eg. ABS(x,y)=SQRT(x2+y2).  This is
therefore useful to calculate the distance between two points (using pythagoras' method).

Example:
PRINT ABS(100-10,75-20)
Three parameters can be used to find the distance between two points in three dimensional space.
Any more parameters take you into the realm of theoretical mathematics.

CROSS-REFERENCE:
See SGN and SGN%
